You are here: Trading System Programming > Reference > Classes > OrderResults > OrderResults Methods > getErrors

getErrors

The getErrors method returns an array of error strings sent by trading broker.

Syntax

var getErrors();

Return Value

This method returns an array of string objects.

Example

The following example demonstrates the use getErrors() method.

 

function onOrder(account, order, orderResults)

{

//check to see if there are errors in orderResults object

if(orderResults.length > 0)

{

//print all errors to debug console

for(var i = 0; i < orderResults.lengh; i++)

{

Debug.writeLine("error: " + orderResults[i]);

}

 

//because we had errors, do not proceed...

return;

}

 

//if order was a limit order, cancel it

if(order.getOrderType() == ORDERTYPE_LIMIT)

{

account.placeOrderCancel(order);

}

}

 


Copyright © 2006-2009 ActiveTick LLC